<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "{{%resource_app_adspace_map}}".
 *
 * @property integer $id
 * @property integer $app_id
 * @property integer $adspace_id
 * @property integer $adspace_type
 * @property integer $status
 * @property string $last_update
 */
class ResourceAppAdspaceMap extends \app\models\BaseAR
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%resource_app_adspace_map}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['app_id', 'adspace_id'], 'required'],
            [['app_id', 'adspace_id', 'adspace_type', 'status'], 'integer'],
            [['last_update'], 'safe'],
            [['app_id', 'adspace_id', 'adspace_type'], 'unique', 'targetAttribute' => ['app_id', 'adspace_id', 'adspace_type'], 'message' => 'The combination of App ID, Adspace ID and Adspace Type has already been taken.']
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'app_id' => 'App ID',
            'adspace_id' => 'Adspace ID',
            'adspace_type' => 'Adspace Type',
            'status' => 'Status',
            'last_update' => 'Last Update',
        ];
    }
}
